[NDGL-16] detekt, ktlint 적용 및 CI/CD 구성#7
Conversation
Walkthrough코드 품질 도구(KtLint/Detekt) 및 CI 워크플로우 추가, 빌드 로직(플러그인) 재구성, 일부 릴리스 빌드 설정 및 여러 파일의 포맷/정리와 빈 파일 제거가 적용되었습니다. Changes
Sequence Diagram(s)(조건 미충족 — 변경은 주로 구성/포맷 및 리팩토링이며 새로운 다중 컴포넌트 제어 흐름을 도입하지 않음; 다이어그램 생략) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Fix all issues with AI agents
In @.github/workflows/android_ci.yml:
- Around line 42-43: Change the Gradle task invoked in the "Run build" job step:
replace the non-standard task name buildDebug with the standard Android Gradle
Plugin task assembleDebug. Update the run line that currently calls "./gradlew
buildDebug --stacktrace" to call "./gradlew assembleDebug --stacktrace" so the
workflow uses the official assembleDebug task.
In `@app/build.gradle.kts`:
- Around line 8-12: The release build sets isMinifyEnabled = true but does not
specify ProGuard rules; update the buildTypes { release { ... } } block to
include proguardFiles so the release minification uses the standard Android
proguard file and your project rules (e.g., add a call to
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro")). Ensure this is placed alongside the existing
isMinifyEnabled = true in the release block so required classes are kept during
minification.
In `@detekt-config.yml`:
- Around line 78-88: The PackageNaming regex is allowing the literal '?'
character because of the character class `[_?A-Za-z0-9]*`; update the
packagePattern under PackageNaming to remove '?' from the character class so
only valid identifier characters are allowed (e.g., change the group
`(\._?[_?A-Za-z0-9]*)*` to use `_?[A-Za-z0-9]*` instead), ensuring the pattern
still matches dot-separated package segments but forbids '?' in package names.
In `@gradle/libs.versions.toml`:
- Around line 47-50: The ktlint-source version (ktlint-source = "0.50.0") is
incompatible with Kotlin 2.0; update the libs.versions.toml entry for
ktlint-source to a Kotlin-2-compatible release (use a 1.4.x or newer
ktlint-source version, e.g., set ktlint-source = "1.4.+"/a specific 1.4.x
release) so ktlint can parse Kotlin 2.0 syntax and metadata; after changing the
ktlint-source value, run the build/CI and ktlint tasks to verify no parsing
errors remain (look for the ktlint-source key to locate the change).
🧹 Nitpick comments (1)
.github/workflows/android_ci.yml (1)
16-31: Gradle 캐싱이 중복으로 설정되어 있습니다.
actions/cache@v4로 Gradle 캐시를 설정하고,actions/setup-java@v4에서도cache: gradle을 사용하고 있어 캐싱이 중복됩니다. 둘 중 하나만 사용해도 충분합니다.♻️ 중복 캐싱 제거 제안
actions/setup-java의 내장 캐싱 사용 (더 간단):- - name: Gradle cache - uses: actions/cache@v4 - with: - path: | - ~/.gradle/caches - ~/.gradle/wrapper - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} - restore-keys: | - ${{ runner.os }}-gradle- - - name: Set up JDK 21 uses: actions/setup-java@v4 with: java-version: '21' distribution: 'temurin' cache: gradle또는 커스텀 캐시 키 유지가 필요하면
setup-java에서cache옵션을 제거하세요.
| buildTypes { | ||
| release { | ||
| isMinifyEnabled = true | ||
| } | ||
| } |
There was a problem hiding this comment.
release 빌드에 ProGuard 설정이 누락되었습니다.
isMinifyEnabled = true를 설정했지만 ProGuard 파일이 지정되지 않았습니다. KotlinAndroid.kt에서 base 설정으로 isMinifyEnabled = false와 proguard 파일을 정의하고 있는데, 여기서 isMinifyEnabled = true로 override하면서 proguard 파일 설정이 누락되면 릴리스 빌드 시 필요한 코드가 제거될 수 있습니다.
🔧 ProGuard 파일 추가 제안
buildTypes {
release {
isMinifyEnabled = true
+ proguardFiles(
+ getDefaultProguardFile("proguard-android-optimize.txt"),
+ "proguard-rules.pro",
+ )
}
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| buildTypes { | |
| release { | |
| isMinifyEnabled = true | |
| } | |
| } | |
| buildTypes { | |
| release { | |
| isMinifyEnabled = true | |
| proguardFiles( | |
| getDefaultProguardFile("proguard-android-optimize.txt"), | |
| "proguard-rules.pro", | |
| ) | |
| } | |
| } |
🤖 Prompt for AI Agents
In `@app/build.gradle.kts` around lines 8 - 12, The release build sets
isMinifyEnabled = true but does not specify ProGuard rules; update the
buildTypes { release { ... } } block to include proguardFiles so the release
minification uses the standard Android proguard file and your project rules
(e.g., add a call to
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro")). Ensure this is placed alongside the existing
isMinifyEnabled = true in the release block so required classes are kept during
minification.
There was a problem hiding this comment.
Project.configureKotlinAndroid()에 포함되어 있음
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check the content of KotlinAndroid.kt to verify ProGuard configuration
cat build-logic/src/main/kotlin/convention/KotlinAndroid.kt
Length of output: 2093
@mj010504 맞습니다! 확인해보니 Project.configureKotlinAndroid()에서 이미 ProGuard 설정이 포함되어 있네요:
buildTypes {
getByName("release") {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro",
)
}
}기본 설정에서 ProGuard 파일이 지정되어 있고, app/build.gradle.kts에서는 isMinifyEnabled만 true로 override하는 것이므로 문제없습니다. 제 리뷰 코멘트가 잘못되었습니다. 설명해주셔서 감사합니다! 🙏
(\__/)
(•ᴗ•)
/>📚 Learning noted!
✏️ Learnings added
Learnt from: mj010504
Repo: YAPP-Github/27th-App-Team-1-Android PR: 7
File: app/build.gradle.kts:8-12
Timestamp: 2026-01-23T07:56:13.976Z
Learning: In the Android project using build-logic convention plugins, the `configureKotlinAndroid()` function in `build-logic/src/main/kotlin/convention/KotlinAndroid.kt` already configures ProGuard files for the release buildType. Individual modules can override just `isMinifyEnabled` without needing to re-specify the ProGuard files.
Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.
291b892 to
f76ae41
Compare
8080c88 to
ac2d9a9
Compare
fe15a8d to
a9b729a
Compare
ef7a0c6 to
6839670
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In @.claude/settings.local.json:
- Around line 1-8: The file .claude/settings.local.json contains local-only
settings (the permissions.allow array) but is committed; decide whether this
should be local-only or shared: if local-only, remove it from the repository and
add .claude/settings.local.json to .gitignore (preserve the permissions.allow
content locally before removing); if intended to be shared, rename to
.claude/settings.json (or split into settings.json + settings.local.json
pattern) and commit the shared file, ensuring the permissions.allow entries are
kept in the shared settings and any local overrides are moved to an ignored
local file.
In `@feature/auth/src/main/java/com/yapp/ndgl/feature/auth/AuthScreen.kt`:
- Around line 14-18: AuthRoute currently declares a viewModel parameter injected
via hiltViewModel() but never uses it; either remove the unused parameter from
AuthRoute (deleting "viewModel: AuthViewModel = hiltViewModel()") or explicitly
mark it as intentionally unused by adding `@Suppress`("UNUSED_PARAMETER") to
AuthRoute, or alternatively pass the viewModel into AuthScreen if it should be
used; reference the AuthRoute function and the AuthViewModel/hiltViewModel()
symbols when applying the change.
🧹 Nitpick comments (1)
feature/home/src/main/java/com/yapp/ndgl/feature/home/HomeScreen.kt (1)
14-17: 사용되지 않는viewModel파라미터가 있습니다.
viewModel파라미터가 선언되었지만HomeScreen()에 전달되지 않고 있습니다. 향후 구현을 위한 placeholder라면 괜찮지만, detekt/ktlint 규칙에서 미사용 파라미터 경고가 발생할 수 있습니다.
| { | ||
| "permissions": { | ||
| "allow": [ | ||
| "Bash(git add:*)", | ||
| "Bash(git rebase:*)", | ||
| "Bash(git fetch:*)" | ||
| ] | ||
| } |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# 확인할 사항들
echo "=== .claude 디렉토리 구조 ==="
find .claude -type f 2>/dev/null | head -20
echo "=== .gitignore에서 .local 관련 항목 ==="
if [ -f .gitignore ]; then
grep -i "local\|\.claude" .gitignore || echo "관련 항목 없음"
fi
echo "=== settings 관련 파일 확인 ==="
find . -name "*settings*" -type f 2>/dev/null | grep -v node_modules | head -20
echo "=== .claude 디렉토리 전체 파일 ==="
ls -la .claude 2>/dev/null || echo ".claude 디렉토리 없음"Repository: YAPP-Github/27th-App-Team-1-Android
Length of output: 688
.claude/settings.local.json의 용도 명확히 필요
파일명의 "local" 접미사는 로컬 전용 설정을 의미하나, 현재 커밋되어 있어 프로젝트 관례와 불일치합니다. 다음 중 하나로 정리를 권장합니다:
- 로컬 전용이면:
.gitignore에 추가 - 팀 공유 설정이면:
settings.json으로 명명 변경 또는 공유/로컬 버전 분리
🤖 Prompt for AI Agents
In @.claude/settings.local.json around lines 1 - 8, The file
.claude/settings.local.json contains local-only settings (the permissions.allow
array) but is committed; decide whether this should be local-only or shared: if
local-only, remove it from the repository and add .claude/settings.local.json to
.gitignore (preserve the permissions.allow content locally before removing); if
intended to be shared, rename to .claude/settings.json (or split into
settings.json + settings.local.json pattern) and commit the shared file,
ensuring the permissions.allow entries are kept in the shared settings and any
local overrides are moved to an ignored local file.
| fun AuthRoute( | ||
| viewModel: AuthViewModel = hiltViewModel(), | ||
| ) { | ||
|
|
||
| AuthScreen() | ||
| } |
There was a problem hiding this comment.
사용되지 않는 viewModel 파라미터
viewModel이 hiltViewModel()을 통해 주입되지만 함수 본문에서 사용되지 않습니다. 향후 구현을 위한 플레이스홀더라면 괜찮지만, 그렇지 않다면 제거하거나 @Suppress("UNUSED_PARAMETER")를 추가하여 의도를 명확히 하는 것이 좋습니다.
♻️ 의도적인 경우 제안
`@Composable`
fun AuthRoute(
+ `@Suppress`("UNUSED_PARAMETER")
viewModel: AuthViewModel = hiltViewModel(),
) {
AuthScreen()
}🤖 Prompt for AI Agents
In `@feature/auth/src/main/java/com/yapp/ndgl/feature/auth/AuthScreen.kt` around
lines 14 - 18, AuthRoute currently declares a viewModel parameter injected via
hiltViewModel() but never uses it; either remove the unused parameter from
AuthRoute (deleting "viewModel: AuthViewModel = hiltViewModel()") or explicitly
mark it as intentionally unused by adding `@Suppress`("UNUSED_PARAMETER") to
AuthRoute, or alternatively pass the viewModel into AuthScreen if it should be
used; reference the AuthRoute function and the AuthViewModel/hiltViewModel()
symbols when applying the change.
개요
변경사항
테스트 체크 리스트
Summary by CodeRabbit
릴리스 노트
Chores
Style
✏️ Tip: You can customize this high-level summary in your review settings.